<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

	{if !$Request.param.uid}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('客户')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-customer_id" data-rule="required" data-source="facrm/customer/index" class="form-control selectpage" name="row[customer_id]" type="text" value="{$Request.param.customer_id}">
        </div>
    </div>
	{/if}
	{if !$Request.param.customer_id}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('用户')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-uid" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" data-search-field="nickname,phone" data-primary-key="uid" class="form-control selectpage" name="row[uid]" type="text" value="{$Request.param.uid}">
        </div>
    </div>
	{/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Relation')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-relation" data-rule="required" class="form-control selectpicker" name="row[relation]">
                {foreach name="relationList" item="vo"}
                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>

	{foreach $questions as $key=>$item}
    <div class="form-group col-md-3 col-xs-6">
        <label class="control-label col-xs-12 col-sm-4">{$item.title}:</label>
        <div class="col-xs-12 col-sm-8">
			{foreach $item as $k=>$v}
			<input type="hidden" name="row[points][{$key}][{$k}]" value="{$v}">
			{/foreach}
            <input type="number" data-rule="required;integer;range(0~10)" class="form-control" name="row[points][{$key}][point]" value="0">
        </div>
    </div>
	{/foreach}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
